Skip to content

Add bulk page operations (move, copy, delete) with multi-select UI#338

Merged
2witstudios merged 4 commits intomasterfrom
claude/multi-select-cross-drive-4THr8
Feb 3, 2026
Merged

Add bulk page operations (move, copy, delete) with multi-select UI#338
2witstudios merged 4 commits intomasterfrom
claude/multi-select-cross-drive-4THr8

Conversation

@2witstudios
Copy link
Owner

Summary

This PR adds comprehensive bulk page operations to PageSpace, enabling users to efficiently manage multiple pages at once. It includes three new API endpoints for bulk operations and a multi-select UI with a toolbar for executing these operations.

Key Changes

API Endpoints

  • POST /api/pages/bulk-copy - Copy multiple pages to a target drive/folder with optional recursive child copying
  • POST /api/pages/bulk-move - Move multiple pages across drives with circular reference validation and recursive drive ID updates for children
  • DELETE /api/pages/bulk-delete - Trash multiple pages with options to recursively trash or orphan children
  • POST /api/pages/tree - Fetch the page tree structure for a drive (used by dialogs for destination selection)

UI Components

  • MultiSelectToolbar - Sticky toolbar that appears when pages are selected, providing quick access to move, copy, and delete actions
  • MovePageDialog - Modal for selecting destination drive and folder when moving pages
  • CopyPageDialog - Modal for selecting destination drive and folder when copying pages, with option to include child pages
  • Updated PageTree component to integrate the multi-select toolbar

Implementation Details

  • All endpoints require authentication (session or MCP) with CSRF protection
  • Comprehensive permission checks: users must have view access to source pages and edit access to target drives
  • Circular reference validation prevents moving a page into its own descendants
  • Recursive operations handle nested page hierarchies correctly
  • Database transactions ensure atomicity of bulk operations
  • Cache invalidation and WebSocket events broadcast changes to connected clients
  • Proper error handling with user-friendly error messages
  • Support for both same-drive and cross-drive operations

Technical Notes

  • Uses Zod for request validation
  • Leverages existing permission utilities (canUserViewPage, canUserEditPage, canUserDeletePage)
  • Integrates with existing caching system (pageTreeCache, agentAwarenessCache)
  • WebSocket events include operation metadata (count, action type, target info)

https://claude.ai/code/session_01CEWo9vztg3kJy4amDGUagP

…drives

- Add useMultiSelectStore for tracking selection state and mode
- Update PageTreeItem with checkbox UI when in multi-select mode
- Add context menu options: "Select multiple", "Move to...", "Copy to..."
- Create MovePageDialog for moving pages to another drive with folder picker
- Create CopyPageDialog for copying pages with optional child pages
- Create MultiSelectToolbar showing selected count with bulk action buttons
- Add API endpoints:
  - POST /api/pages/tree - fetch page tree for drive selection
  - POST /api/pages/bulk-move - move multiple pages across drives
  - POST /api/pages/bulk-copy - copy pages with recursive children
  - DELETE /api/pages/bulk-delete - bulk trash pages

https://claude.ai/code/session_01CEWo9vztg3kJy4amDGUagP
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 50 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/multi-select-cross-drive-4THr8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f24728b032

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

2witstudios and others added 3 commits February 2, 2026 13:27
- Fix NULL parent lookup for root-level operations (use isNull instead of empty string)
- Fix role check to use valid MemberRole values (OWNER|ADMIN instead of EDITOR)
- Fix agent cache invalidation to check AI_CHAT pages in trashed children
- Fix TypeScript errors in dialog components (use fetchWithAuth for Response)
- Simplify websocket event payloads to match PageEventPayload interface

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@2witstudios 2witstudios merged commit 836ad82 into master Feb 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants